<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <meta charset="utf-8"/>
    <title>     &raquo; \tfc\mvc
</title>
    <meta name="author" content=""/>
    <meta name="description" content=""/>

            <link href="../css/template.css" rel="stylesheet" media="all"/>
    
            <!--[if lt IE 9]>
        
        <![endif]-->
        <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script>
        <script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script>
        <script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script>
        <script src="../js/bootstrap.js" type="text/javascript"></script>
        <script src="../js/template.js" type="text/javascript"></script>
        <script src="../js/prettify/prettify.min.js" type="text/javascript"></script>
    
            <link rel="shortcut icon" href="../img/favicon.ico"/>
        <link rel="apple-touch-icon" href="../img/apple-touch-icon.png"/>
        <link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png"/>
        <link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png"/>
    </head>
<body>

        <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container">
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span> <span class="icon-bar"></span>
                    <span class="icon-bar"></span> </a>
                <a class="brand" href="http://www.trotri.com/">Trotri官网</a><a class="brand" href="../index.html">TFC-Trotri Foundation Classes</a>

                <div class="nav-collapse">
                    <ul class="nav">
                        <li class="dropdown">
                            <a href="#api" class="dropdown-toggle" data-toggle="dropdown">
                                API Documentation <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                                                    <li><a>Namespaces</a></li>
                                                                        <li><a href="../namespaces/tfc.html">tfc</a></li>
                                                                                                                                </ul>
                        </li>
                        <li class="dropdown" id="charts-menu">
                            <a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
                                Charts <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="../graph_class.html">
                                        <i class="icon-list-alt"></i>&#160;Class hierarchy diagram
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown" id="reports-menu">
                            <a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
                                Reports <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="../errors.html">
                                         
                                    </a>
                                </li>
                                <li>
                                    <a href="../markers.html">
                                        <i class="icon-list-alt"></i>&#160;Markers
                                    </a>
                                </li>
                                <li>
                                    <a href="../deprecated.html">
                                        <i class="icon-list-alt"></i>&#160;Deprecated
                                    </a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="go_to_top">
            <a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>
        </div>
    </div>
    
    <div id="___" class="container">
        <noscript>
            <div class="alert alert-warning">
                Javascript is disabled; several features are only available if Javascript is enabled.
            </div>
        </noscript>

        
            
    <div class="row">

        <div class="span4">
            <div class="btn-group view pull-right" data-toggle="buttons-radio">
                <button class="btn details" title="Show descriptions and method names">
                    <i class="icon-list"></i></button><button class="btn simple" title="Show only method names">
                    <i class="icon-align-justify"></i>
                </button>
            </div>
            <ul class="side-nav nav nav-list">
                <li class="nav-header">
                    <i class="icon-map-marker"></i> Namespaces
                </li>
                    
        <li>
        <a href="../namespaces/tfc.mvc.routes.html" title="routes">
            <i class="icon-th"></i> routes
        </a>
        <ul class="nav nav-list nav-namespaces">
                
    
        </ul>
    </li>
        <li>
        <a href="../namespaces/tfc.mvc.form.html" title="form">
            <i class="icon-th"></i> form
        </a>
        <ul class="nav nav-list nav-namespaces">
                
    
        </ul>
    </li>
        <li>
        <a href="../namespaces/tfc.mvc.interfaces.html" title="interfaces">
            <i class="icon-th"></i> interfaces
        </a>
        <ul class="nav nav-list nav-namespaces">
                
    
        </ul>
    </li>
    
            </ul>
        </div>

        <div class="span8 namespace-contents">
                
    
        <ul class="breadcrumb">
            <li><a href="../index.html"><i class="icon-th"></i></a></li>
                
                
    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.html">tfc</a>
    </li>

    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.mvc.html">mvc</a>
    </li>

        </ul>

        
        
                    <div class="namespace-indent">
                <h3><i class="icon-custom icon-class"></i> Classes, interfaces and traits</h3>
                
                
                                        <div id="class_Html" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Html .collapse">
        <h1>Html<a href="../classes/tfc.mvc.Html.html">¶</a></h1>
        <p class="short_description">Html class file
页面辅助类，帮助创建HTML Element</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.Html.html" class="more">« More »</a>    </div>

                                        <div id="class_Mvc" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Mvc .collapse">
        <h1>Mvc<a href="../classes/tfc.mvc.Mvc.html">¶</a></h1>
        <p class="short_description">Mvc class file
mvc包中类管理器</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.Mvc.html" class="more">« More »</a>    </div>

                                        <div id="class_InlineAction" class="element ajax clickable class" data-toggle="collapse" data-target="#class_InlineAction .collapse">
        <h1>InlineAction<a href="../classes/tfc.mvc.InlineAction.html">¶</a></h1>
        <p class="short_description">InlineAction class file
定义一个Action类，用来代替Controller类的Action方法</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.InlineAction.html" class="more">« More »</a>    </div>

                                        <div id="class_Router" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Router .collapse">
        <h1>Router<a href="../classes/tfc.mvc.Router.html">¶</a></h1>
        <p class="short_description">Router class file
路由器管理类</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.Router.html" class="more">« More »</a>    </div>

                                        <div id="class_Controller" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Controller .collapse">
        <h1>Controller<a href="../classes/tfc.mvc.Controller.html">¶</a></h1>
        <p class="short_description">Controller abstract class file
控制器基类</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.Controller.html" class="more">« More »</a>    </div>

                                        <div id="class_Widget" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Widget .collapse">
        <h1>Widget<a href="../classes/tfc.mvc.Widget.html">¶</a></h1>
        <p class="short_description">Widget abstract class file
页面装饰基类</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.Widget.html" class="more">« More »</a>    </div>

                                        <div id="class_Dispatcher" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Dispatcher .collapse">
        <h1>Dispatcher<a href="../classes/tfc.mvc.Dispatcher.html">¶</a></h1>
        <p class="short_description">Dispatcher class file
发报器类，实例化Controller类，并调用Action方法
必须先将Module目录设置成类自动加载目录，才可以使用此类</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.Dispatcher.html" class="more">« More »</a>    </div>

                                        <div id="class_UrlManager" class="element ajax clickable class" data-toggle="collapse" data-target="#class_UrlManager .collapse">
        <h1>UrlManager<a href="../classes/tfc.mvc.UrlManager.html">¶</a></h1>
        <p class="short_description">UrlManager class file
URL管理类，根据路由规则生成URL</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.UrlManager.html" class="more">« More »</a>    </div>

                                        <div id="class_Action" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Action .collapse">
        <h1>Action<a href="../classes/tfc.mvc.Action.html">¶</a></h1>
        <p class="short_description">Action abstract class file
Action基类，辅助分解Controller类业务，将Controller业务化整为零，方便管理和重用</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.Action.html" class="more">« More »</a>    </div>

                                        <div id="class_View" class="element ajax clickable class" data-toggle="collapse" data-target="#class_View .collapse">
        <h1>View<a href="../classes/tfc.mvc.View.html">¶</a></h1>
        <p class="short_description">View class file
模板解析类，用于分离业务层和展现层</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.View.html" class="more">« More »</a>    </div>

                            </div>
            
                
    
        <ul class="breadcrumb">
            <li><a href="../index.html"><i class="icon-th"></i></a></li>
                
                
                
    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.html">tfc</a>
    </li>

    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.mvc.html">mvc</a>
    </li>

    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.mvc.routes.html">routes</a>
    </li>

        </ul>

        
        
                    <div class="namespace-indent">
                <h3><i class="icon-custom icon-class"></i> Classes, interfaces and traits</h3>
                
                
                                        <div id="class_RouteSimple" class="element ajax clickable class" data-toggle="collapse" data-target="#class_RouteSimple .collapse">
        <h1>RouteSimple<a href="../classes/tfc.mvc.routes.RouteSimple.html">¶</a></h1>
        <p class="short_description">RouteSimple class file
简单路由</p>
        <div class="details collapse"><p>简单路由例子：
URL：<a href="http://domain.com/index.php?c=archive&amp;a=show">http://domain.com/index.php?c=archive&amp;a=show</a></p>
<pre>
$route = new RouteSimple('c', 'a', 'm');
$value = array(
    'module'     => '默认模型',
    'controller' => 'archive',
    'action'     => 'show'
);
</pre></div>
        <a href="../classes/tfc.mvc.routes.RouteSimple.html" class="more">« More »</a>    </div>

                                        <div id="class_RouteRegex" class="element ajax clickable class" data-toggle="collapse" data-target="#class_RouteRegex .collapse">
        <h1>RouteRegex<a href="../classes/tfc.mvc.routes.RouteRegex.html">¶</a></h1>
        <p class="short_description">RouteRegex class file
正则路由</p>
        <div class="details collapse"><p>一.正则路由例子：
URL：<a href="http://domain.com/archive/2012">http://domain.com/archive/2012</a></p>
<pre>
$route = new RouteRegex(
    'archive/(\d+)',
    array(
        'controller' => 'archive',
        'action'     => 'show'
    )
);
$value = array(
    'controller' => 'archive',
    'action'     => 'show',
    1            => '2012'
);
</pre>
<p>二.上面例子中整数键不容易管理，下面方式解决：</p>
<pre>
$route = new RouteRegex(
    'archive/(\d+)',
    array(
        'controller' => 'archive',
        'action'     => 'show'
    ),
    array(
        1 => 'year'
    )
);
$value = array(
    'controller' => 'archive',
    'action'     => 'show',
    'year'       => '2012'
);
</pre>
<p>三.如果URL的地址是：<a href="http://domain.com/archive，即后面缺省2012时，下面方式解决">http://domain.com/archive，即后面缺省2012时，下面方式解决</a>：</p>
<pre>
$route = new RouteRegex(
    'archive(?:/(\d+))?',
    array(
        1            => '2012',
        'controller' => 'archive',
        'action'     => 'show'
    ),
    array(
        1 => 'year'
    )
);
$value = array(
    'controller' => 'archive',
    'action'     => 'show',
    'year'       => '2012'
);
</pre>
<p>四.URL中有多个匹配：
URL：<a href="http://domain.com/iphper/page/8">http://domain.com/iphper/page/8</a></p>
<pre>
$route = new RouteRegex(
    '(\w+)/page/(\d+)',
    array(
        'controller' => 'profile',
        'action'     => 'userinfo'
    ),
    array(
        2 => 'page'
    )
);
$value = array(
    'controller' => 'profile',
    'action'     => 'userinfo',
    1            => 'iphper',
    'page'       => '8'
);
</pre>
<p>五.URL中有多个参数：
URL：<a href="http://domain.com/archive/2012/username/iphper/page/2">http://domain.com/archive/2012/username/iphper/page/2</a></p>
<pre>
$route = new RouteRegex(
    'archive/(\d+)',
    array(
        'controller' => 'archive',
        'action'     => 'show'
    ),
    array(
        2 => 'page'
    )
);
$value = array(
    'controller' => 'archive',
    'action'     => 'show',
    1            => '2012',
    'username'   => 'iphper',
    'page'       => '2'
);
</pre></div>
        <a href="../classes/tfc.mvc.routes.RouteRegex.html" class="more">« More »</a>    </div>

                                        <div id="class_RouteRewrite" class="element ajax clickable class" data-toggle="collapse" data-target="#class_RouteRewrite .collapse">
        <h1>RouteRewrite<a href="../classes/tfc.mvc.routes.RouteRewrite.html">¶</a></h1>
        <p class="short_description">RouteRewrite class file
标准路由</p>
        <div class="details collapse"><p>一.标准路由例子：
URL：<a href="http://domain.com/author/iphper">http://domain.com/author/iphper</a></p>
<pre>
$route = new RouteRewrite(
    'author/:username',
    array(
        'controller' => 'profile',
        'action'     => 'userinfo'
    )
);
$value = array(
    'controller' => 'profile',
    'action'     => 'userinfo',
    'username'   => 'iphper'
);
</pre>
<p>二.规则匹配：
URL：<a href="http://domain.com/archive/2012">http://domain.com/archive/2012</a></p>
<pre>
$route = new RouteRewrite(
    'archive/:year',
    array(
        'controller' => 'archive',
        'action'     => 'show'
    ),
    array(
        'year'    => '\d+'
    )
);
$value = array(
    'controller' => 'archive',
    'action'     => 'show',
    'year'       => '2012'
);
如果URL：http://domain.com/archive/test，将不匹配，并且尝试匹配下一个路由
</pre>
<p>三.有缺省值时，规则匹配：
URL：<a href="http://domain.com/archive">http://domain.com/archive</a></p>
<pre>
$route = new RouteRewrite(
    'archive/:year',
    array(
        'year'       => '2012',    // 缺省值
        'controller' => 'archive',
        'action'     => 'show'
    )
);
$value = array(
    'year'       => '2012',
    'controller' => 'archive',
    'action'     => 'show'
);
</pre>
<p>四.模仿模块路由：
URL：<a href="http://domain.com/passport/profile/userinfo/username/iphper">http://domain.com/passport/profile/userinfo/username/iphper</a></p>
<pre>
$route = new RouteRewrite(
    ':module/:controller/:action/*',
    array(
       'module' => 'default'    // 缺省值
    )
);
$value = array(
    'module'     => 'passport',
    'controller' => 'profile',
    'action'     => 'userinfo',
    'username'   => 'iphper'
);
如果URL：http://domain.com/archive/test，将不匹配，并且尝试匹配下一个路由
</pre></div>
        <a href="../classes/tfc.mvc.routes.RouteRewrite.html" class="more">« More »</a>    </div>

                                        <div id="class_RouteStatic" class="element ajax clickable class" data-toggle="collapse" data-target="#class_RouteStatic .collapse">
        <h1>RouteStatic<a href="../classes/tfc.mvc.routes.RouteStatic.html">¶</a></h1>
        <p class="short_description">RouteStatic class file
静态路由</p>
        <div class="details collapse"><p>静态路由例子：
URL：<a href="http://domain.com/login">http://domain.com/login</a></p>
<pre>
$route = new RouteStatic(
    'login',
    array(
        'module'     => 'main',
        'controller' => 'auth',
        'action'     => 'login'
    )
);
$value = array(
    'module'     => 'main',
    'controller' => 'auth',
    'action'     => 'login'
);
</pre></div>
        <a href="../classes/tfc.mvc.routes.RouteStatic.html" class="more">« More »</a>    </div>

                                        <div id="class_Route" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Route .collapse">
        <h1>Route<a href="../classes/tfc.mvc.routes.Route.html">¶</a></h1>
        <p class="short_description">Route abstract class file
路由器基类</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.routes.Route.html" class="more">« More »</a>    </div>

                                        <div id="class_RouteSupervar" class="element ajax clickable class" data-toggle="collapse" data-target="#class_RouteSupervar .collapse">
        <h1>RouteSupervar<a href="../classes/tfc.mvc.routes.RouteSupervar.html">¶</a></h1>
        <p class="short_description">RouteSupervar class file
默认路由</p>
        <div class="details collapse"><p>一.默认路由例子：
URL：<a href="http://domain.com/index.php?r=archive/show">http://domain.com/index.php?r=archive/show</a></p>
<pre>
$route = new RouteSupervar('r');
$value = array(
    'module'     => '默认模型',
    'controller' => 'archive',
    'action'     => 'show'
);
</pre>
<p>二.默认路由例子：
URL：<a href="http://domain.com/index.php?r=main/archive/show">http://domain.com/index.php?r=main/archive/show</a></p>
<pre>
$route = new RouteSupervar('r');
$value = array(
    'module'     => 'main',
    'controller' => 'archive',
    'action'     => 'show'
);
</pre>
<p>三.默认路由例子：
URL：<a href="http://domain.com/index.php?r=archive">http://domain.com/index.php?r=archive</a></p>
<pre>
$route = new RouteSupervar('r');
$value = array(
    'module'     => '默认模型',
    'controller' => 'archive',
    'action'     => '默认方法'
);
</pre></div>
        <a href="../classes/tfc.mvc.routes.RouteSupervar.html" class="more">« More »</a>    </div>

                            </div>
            
    
                
    
        <ul class="breadcrumb">
            <li><a href="../index.html"><i class="icon-th"></i></a></li>
                
                
                
    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.html">tfc</a>
    </li>

    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.mvc.html">mvc</a>
    </li>

    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.mvc.form.html">form</a>
    </li>

        </ul>

        
        
                    <div class="namespace-indent">
                <h3><i class="icon-custom icon-class"></i> Classes, interfaces and traits</h3>
                
                
                                        <div id="class_ButtonElement" class="element ajax clickable class" data-toggle="collapse" data-target="#class_ButtonElement .collapse">
        <h1>ButtonElement<a href="../classes/tfc.mvc.form.ButtonElement.html">¶</a></h1>
        <p class="short_description">ButtonElement class file
按钮类表单元素</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.form.ButtonElement.html" class="more">« More »</a>    </div>

                                        <div id="class_Element" class="element ajax clickable class" data-toggle="collapse" data-target="#class_Element .collapse">
        <h1>Element<a href="../classes/tfc.mvc.form.Element.html">¶</a></h1>
        <p class="short_description">Element abstract class file
表单元素基类</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.form.Element.html" class="more">« More »</a>    </div>

                                        <div id="class_FormBuilder" class="element ajax clickable class" data-toggle="collapse" data-target="#class_FormBuilder .collapse">
        <h1>FormBuilder<a href="../classes/tfc.mvc.form.FormBuilder.html">¶</a></h1>
        <p class="short_description">FormBuilder abstract class file
表单处理基类，需要加载模板文件才能生成表单</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.form.FormBuilder.html" class="more">« More »</a>    </div>

                                        <div id="class_InputElement" class="element ajax clickable class" data-toggle="collapse" data-target="#class_InputElement .collapse">
        <h1>InputElement<a href="../classes/tfc.mvc.form.InputElement.html">¶</a></h1>
        <p class="short_description">InputElement class file
输入框类表单元素</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.form.InputElement.html" class="more">« More »</a>    </div>

                            </div>
            
    
                
    
        <ul class="breadcrumb">
            <li><a href="../index.html"><i class="icon-th"></i></a></li>
                
                
                
    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.html">tfc</a>
    </li>

    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.mvc.html">mvc</a>
    </li>

    
    <li>
        <span class="divider">\</span><a href="../namespaces/tfc.mvc.interfaces.html">interfaces</a>
    </li>

        </ul>

        
        
                    <div class="namespace-indent">
                <h3><i class="icon-custom icon-class"></i> Classes, interfaces and traits</h3>
                
                                        <div id="interface_View" class="element ajax clickable interface" data-toggle="collapse" data-target="#interface_View .collapse">
        <h1>View<a href="../classes/tfc.mvc.interfaces.View.html">¶</a></h1>
        <p class="short_description">View interface file
模板解析接口，用于分离业务层和展现层</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.interfaces.View.html" class="more">« More »</a>    </div>

                                        <div id="interface_Action" class="element ajax clickable interface" data-toggle="collapse" data-target="#interface_Action .collapse">
        <h1>Action<a href="../classes/tfc.mvc.interfaces.Action.html">¶</a></h1>
        <p class="short_description">Action interface file
Action接口，辅助分解Controller类业务，将Controller业务化整为零，方便管理和重用</p>
        <div class="details collapse"></div>
        <a href="../classes/tfc.mvc.interfaces.Action.html" class="more">« More »</a>    </div>

                
                            </div>
            
    
    
        </div>
    </div>
    </div>

        <footer class="span12">
            Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by
            <a href="http://glyphicons.com/">Glyphicons</a>.<br/>
            Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and<br/>
            generated on Sat, 27 Dec 2014 06:16:37 +0000.<br/>
    </footer>
    </body>
</html>
